package demo7;

public class test2 {
    public static void main(String[] args) {
        String regex1 = "\\w{4,16}";
        System.out.println("zhangsan".matches(regex1));
        System.out.println("lisi".matches(regex1));
        System.out.println("wangwu".matches(regex1));
        System.out.println("$123".matches(regex1));

        System.out.println("=================");

        String regex2 = "[1-9]\\d{16}(\\d|X|x)";
        String regex3 = "[1-9]\\d{16}[\\dXx]";
        System.out.println("440684200309233813".matches(regex2));
        System.out.println("440684200309233813".matches(regex3));

        String regex5 = "a((?i)b)c";
        String regex4 = "a((?i)b)c";
        System.out.println("=================");
        System.out.println("abc".matches(regex4));
        System.out.println("ABC".matches(regex4));
        System.out.println("aBc".matches(regex5));

        System.out.println("=================");
        String regex6 = "[1-9]\\d{5}(18|19|20)\\d{2}(0[1-9]|1[0-2])(0[1-9]|[12]\\d|3[01])\\d{3}[\\dXx]";
        System.out.println("440684200309233813".matches(regex6));

        System.out.println("=================");
        String regex7 = "[1-9]\\d{5}(18|19|20)\\d{2}(0\\d|10|11|12)(0[1-9]|[1-2]\\d|30|31)\\d{3}[\\dXx]";
        System.out.println("440684200309233813".matches(regex7));



    }
}
